//
//  oldServiceDetailInfoViewController.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/3/13.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldServiceDetailInfoViewController.h"
#import "oldPublishDemandViewController.h"
#import "oldFamilySendOrderViewController.h"

@interface oldServiceDetailInfoViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *img_service;
@property (weak, nonatomic) IBOutlet UILabel *label_name;
@property (weak, nonatomic) IBOutlet UILabel *label_price;
@property (weak, nonatomic) IBOutlet UILabel *label_content;
@property (weak, nonatomic) IBOutlet UIButton *btn_confirm;
@property (weak, nonatomic) IBOutlet UILabel *label_time;

@end

@implementation oldServiceDetailInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
    [self initData];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - initView
- (void)initView
{
    _btn_confirm.layer.cornerRadius = 6.f;
    [_btn_confirm addTarget:self action:@selector(btn_confirm_tapped:) forControlEvents:UIControlEventTouchDown];
}

- (void)btn_confirm_tapped:(id)sender
{
    oldFamilySendOrderViewController *vc = [oldFamilySendOrderViewController new];
    vc.hidesBottomBarWhenPushed = YES;
    vc.serviceInfo = _service;
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - initData
- (void)initData
{
    _label_name.text = _service.cname;
    _label_price.text = [NSString stringWithFormat:@"服务价格：¥%@", _service.price];
    _label_time.text = [NSString stringWithFormat:@"服务时间：约%ld分钟", (long)[_service getTimeCostByMinutes]];
    _label_content.text = _service.content;
    [_img_service showImage:_service.pic];
    self.navigationItem.title = _service.cname;
}

@end
